package Payment;

/**
 * CashPayment extends of Payment class/ for customer choose to pay by cash
 * @author Sara Pulis
 */
public class CashPayment extends Payment{

    private float amountTendered;

    public CashPayment() {
        type = "Cash";
        transactionTotal = 0;
        amountTendered = 0;
    }

    public CashPayment(float total, float amountGiven) {
        type = "Cash";
        transactionTotal = total;
        amountTendered = amountGiven;
    }

    public String toString() {
        return ("$" + amountTendered);
    }

    @Override
    public float getTotal() {
        return transactionTotal;
    }

    @Override
    public boolean verify() {
        return true;
    }

    @Override
    public float getChange() {
        return (amountTendered - transactionTotal);
    }


}
